<div class="employees view">
<h2><?php echo __('Employee'); ?></h2>
	<dl>
		<dt><?php echo __('Employee Id'); ?></dt>
		<dd>
			<?php echo h($employee['Employee']['employee_id']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Employee Code'); ?></dt>
		<dd>
			<?php echo h($employee['Employee']['employee_code']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Employee Name'); ?></dt>
		<dd>
			<?php echo h($employee['Employee']['employee_name']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Employee Phone'); ?></dt>
		<dd>
			<?php echo h($employee['Employee']['employee_phone']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Account'); ?></dt>
		<dd>
			<?php echo $this->Html->link($employee['Account']['account_name'], array('controller' => 'accounts', 'action' => 'view', $employee['Account']['account_id'])); ?>
			&nbsp;
		</dd>
	</dl>
</div>
<div class="actions">
	<h3><?php echo __('Actions'); ?></h3>
	<ul>
		<li><?php echo $this->Html->link(__('Edit Employee'), array('action' => 'edit', $employee['Employee']['employee_id'])); ?> </li>
		<li><?php echo $this->Form->postLink(__('Delete Employee'), array('action' => 'delete', $employee['Employee']['employee_id']), array(), __('Are you sure you want to delete # %s?', $employee['Employee']['employee_id'])); ?> </li>
		<li><?php echo $this->Html->link(__('List Employees'), array('action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Employee'), array('action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Accounts'), array('controller' => 'accounts', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Account'), array('controller' => 'accounts', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Purchases'), array('controller' => 'purchases', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Purchase'), array('controller' => 'purchases', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Sales'), array('controller' => 'sales', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Sale'), array('controller' => 'sales', 'action' => 'add')); ?> </li>
	</ul>
</div>
<div class="related">
	<h3><?php echo __('Related Purchases'); ?></h3>
	<?php if (!empty($employee['Purchase'])): ?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php echo __('Purchase Id'); ?></th>
		<th><?php echo __('Purchase Code'); ?></th>
		<th><?php echo __('Vendor Id'); ?></th>
		<th><?php echo __('Employee Id'); ?></th>
		<th><?php echo __('Date Purchase'); ?></th>
		<th><?php echo __('Subtotal'); ?></th>
		<th><?php echo __('Discount For Buyer'); ?></th>
		<th><?php echo __('Total'); ?></th>
		<th><?php echo __('Dept'); ?></th>
		<th><?php echo __('Purchase Description'); ?></th>
		<th class="actions"><?php echo __('Actions'); ?></th>
	</tr>
	<?php foreach ($employee['Purchase'] as $purchase): ?>
		<tr>
			<td><?php echo $purchase['purchase_id']; ?></td>
			<td><?php echo $purchase['purchase_code']; ?></td>
			<td><?php echo $purchase['vendor_id']; ?></td>
			<td><?php echo $purchase['employee_id']; ?></td>
			<td><?php echo $purchase['date_purchase']; ?></td>
			<td><?php echo $purchase['subtotal']; ?></td>
			<td><?php echo $purchase['discount_for_buyer']; ?></td>
			<td><?php echo $purchase['total']; ?></td>
			<td><?php echo $purchase['dept']; ?></td>
			<td><?php echo $purchase['purchase_description']; ?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View'), array('controller' => 'purchases', 'action' => 'view', $purchase['purchase_id'])); ?>
				<?php echo $this->Html->link(__('Edit'), array('controller' => 'purchases', 'action' => 'edit', $purchase['purchase_id'])); ?>
				<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'purchases', 'action' => 'delete', $purchase['purchase_id']), array(), __('Are you sure you want to delete # %s?', $purchase['purchase_id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Purchase'), array('controller' => 'purchases', 'action' => 'add')); ?> </li>
		</ul>
	</div>
</div>
<div class="related">
	<h3><?php echo __('Related Sales'); ?></h3>
	<?php if (!empty($employee['Sale'])): ?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php echo __('Sale Id'); ?></th>
		<th><?php echo __('Sale Code'); ?></th>
		<th><?php echo __('Customer Id'); ?></th>
		<th><?php echo __('Employee Id'); ?></th>
		<th><?php echo __('Date Sell'); ?></th>
		<th><?php echo __('Subtotal'); ?></th>
		<th><?php echo __('Discount For Buyer'); ?></th>
		<th><?php echo __('Total'); ?></th>
		<th><?php echo __('Sale Description'); ?></th>
		<th class="actions"><?php echo __('Actions'); ?></th>
	</tr>
	<?php foreach ($employee['Sale'] as $sale): ?>
		<tr>
			<td><?php echo $sale['sale_id']; ?></td>
			<td><?php echo $sale['sale_code']; ?></td>
			<td><?php echo $sale['customer_id']; ?></td>
			<td><?php echo $sale['employee_id']; ?></td>
			<td><?php echo $sale['date_sell']; ?></td>
			<td><?php echo $sale['subtotal']; ?></td>
			<td><?php echo $sale['discount_for_buyer']; ?></td>
			<td><?php echo $sale['total']; ?></td>
			<td><?php echo $sale['sale_description']; ?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View'), array('controller' => 'sales', 'action' => 'view', $sale['sale_id'])); ?>
				<?php echo $this->Html->link(__('Edit'), array('controller' => 'sales', 'action' => 'edit', $sale['sale_id'])); ?>
				<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'sales', 'action' => 'delete', $sale['sale_id']), array(), __('Are you sure you want to delete # %s?', $sale['sale_id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Sale'), array('controller' => 'sales', 'action' => 'add')); ?> </li>
		</ul>
	</div>
</div>
